#include<iostream>
using namespace std;

int main()
{
	int a = 0;
	int s = 0;
	
	cin >> a;
	while(a)
	{
		cin >> s;
		int x = 1;
		int y = 1;
		int z = 1;
		
		while(s >= 3)
		{
			z = x + y;
			x = y;
			y = z;
			s--;
		}
		a--;
		cout << z << endl;
	}
	
	return 0;
}

